package arrayCopy;

import java.util.Arrays;

public class ArrayCopy {
	public static void main(String[] args) {
		int a[]={1,7,9,11,13,15,17,19};
		int b[]={2,4,6,8,10};
		int c[]=new int[a.length+b.length];
		int e[]=Arrays.copyOfRange(a, 0, 5);
		int f[]=new int[a.length+b.length];
		System.arraycopy(a, 0, f, 0, a.length);
		System.arraycopy(a, 0, c, 0, a.length);
		System.arraycopy(b, 0, c, a.length, b.length);
		print(c);
//		Arrays.sort(c,0,a.length+1);
//		print(c);
		Arrays.sort(c);
		print(c);
		print(e);
	}

	private static void print(int[] c) {

		for(int i=0;i<c.length;i++){
			System.out.print(c[i]+" " );
		}
		System.out.println();
	}

}
